<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>随机点名器</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>

<body>
    <ul>

    </ul>
    <script>
        let temp = '王超泷,张硕,郑帅伟,陆鹏宇,刘云才,段庆庆,杨晨曦,' +
            '张向科,赵耀林,王伟静,席翎棋,赵大方,姜亚晨,张泽凯,胡慧慧,' +
            '葛皓斌,王晓锐,余文浩,司赫,张威振,'+
            '吴玉瑶,马亚捷,郭万杰,包瑞,王木,王腾飞,邱志浩,'+
            '靳波涛,陈新萍,许远洋,韩雨洁,杨森,杜俊豪,韩君可,'+
            '李乘郴,袁凯威,张金源,武帅旗,田明洋,许紫麟,'+
            '李宝香,吴礼贞,焦帅旗,韩桩,田鹏辉,李富乐,王邵晟,'+
            '马国庆,高慧艳,肖玉林,赵俊威,张世刚,王建旺,李桂山,陈俊波';

        let list = temp.split(',');
        // 我们想要得到两个数之间的随机整数 并且 包含这2个整数
        // Math.floor(Math.random() * (max - min + 1)) + min;
        function getRandom(min, max) {
            return Math.floor(Math.random() * (max - min + 1)) + min;
        }
        // let index = getRandom(0, list.length);
        // console.log(list[index]);
        // alert(list[index]);
        let ul = document.querySelector('ul');

        for (let i = 0; i < 10; i++) {
            let index = getRandom(0, list.length - 1);
            let temp = list[index];
            let li = $(`<li><h2>${temp}</h2></li>`);
            $('ul').append(li);
        }

    </script>
</body>

</html>